import axios from 'axios';

const contentPath = '/system/user'

export function create(user: any) {
  return axios.post(`${contentPath}`, user)
}

export function update(user: any) {
  return axios.put(`${contentPath}`, user)
}

export function deleteById(id: number) {
  return axios.delete(`${contentPath}/${id}`)
}

export function findUserInfo() {
  return axios.get('/system/self/info')
}

export function findById(id: number) {
  return axios.get(`${contentPath}/${id}`)
}

export function listWithPagination(pageable: any, param: any) {
  return axios.get(`${contentPath}/pagination`, {
    params: {
      ...pageable,
      ...param
    }
  })
}
